MAPS
Photo by Tasos Mansour on Unsplash
Sometimes the meaning in life hits you like a meteorite…
— Curtis Tyrone Jones
df <- read.csv("archetypes/meteorite-landings/meteorite-landings.csv", header = TRUE, stringsAsFactors = FALSE)
head(df, n=10)
df_simplified <- df %>% dplyr::mutate(reclat = round(reclat, digits = 2), reclong = round(reclong, digits = 2)) %>%
group_by(reclat, reclong) %>%
summarise(mass_total = sum(mass))
df_simplified
df_sorted <- df_simplified[order(df_simplified$mass_total),]
df_sorted <- df_sorted %>% mutate(mass_total = round(mass_total, digits = 0))
ne_world <- ne_countries(scale = "small", returnclass = "sf")
theme_opts <- theme(
text = element_text(family = "inconsolata"),
plot.title = element_text(color = "#8D9592", size = 14, face = "bold", family = "inconsolata"),
plot.subtitle = element_text(color = "#8D9592", size = 11, family = "inconsolata"),
plot.caption = element_text(color = "#8D9592", size = 8, family = "inconsolata"),
plot.background = element_rect(fill = "#0b131a", color = "#0b131a"),
panel.grid = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.background=element_rect(fill="#0b131a", colour=NA),
panel.border = element_blank(),
axis.text = element_blank(),
axis.line = element_blank(),
axis.ticks = element_blank(),
axis.title = element_blank(),
legend.position = "bottom",
legend.background = element_rect(fill = "#0b131a", color = "#0b131a"),
legend.text = element_text(color = "#8D9592", size = 10, family = "inconsolata"),
legend.key.width = unit(3, 'cm'),
legend.title = element_blank()
)
v1 <- ggplot(data = ne_world) +
geom_sf(fill="#081b2a", color="#09325b", stroke=0.5) +
geom_point( data = df_sorted, aes(x=reclong, y=reclat, color=mass_total, alpha=mass_total), shape = 8, size = 1.25) +
scale_color_gradient(low = "yellow", high = "red", na.value = NA, label = function(x) sprintf("%.0f", x)) +
scale_alpha_continuous( range = c(0.1, 0.7), guide = "none") +
xlim(-180, 180) +
ylim(-90, 90) +
labs(x=NULL,
y=NULL,
title = "Meteorite Landings",
subtitle="color and alpha by mass") +
theme_bw() +
theme_opts
girafe(ggobj = v1, width_svg = 16, height_svg = 9,
options = list(opts_sizing(rescale = TRUE, width = 0.8)))